/**
 * 安卓白金英雄坛制作组 <br>
 * 文件名：TalkingWindow.java <br>
 * 创建时间：2013-8-24 上午10:13:06 <br>
 * 所属项目：GmudEX <br>
 * @author 12548 <br>
 */
package lostland.gmud.exv2.ui;

import com.orhanobut.logger.Logger;

import java.util.ArrayList;

import lostland.gmud.exv2.FontSize;
import lostland.gmud.exv2.Game;
import lostland.gmud.exv2.GameConstants;
import lostland.gmud.exv2.blgframework.impl.BLGGraphics;
import lostland.gmud.exv2.ui.core.GmudWindow;

/**
 * 类名：TalkingWindow <br>
 * 说明：对话窗口
 *
 * @author 12548
 */
public class EventWindow extends GmudWindow {

	String s;

	boolean b = false;

	public ArrayList<String> pages;
	BLGGraphics g = (BLGGraphics) Game.getInstance().getGraphics();
	public int page = 0;

	/**
	 * @return 分页数
	 */
	public int getPages() {
		return pages.size();
	}

	public EventWindow(String s) {
		super(0, 0, GameConstants.FBWIDTH, 40);
		Logger.i("Spliting:" + s);
		pages = g.splitString(s, FontSize.FT_12PX, width - 8, 2);
	}

	public EventWindow(ArrayList<String> pages, boolean splited) {
		super(0, 0, GameConstants.FBWIDTH, 40);
		this.pages = pages;
		b = true;
	}

	/* （非 Javadoc）
	 * @see lostland.gmud.exv2.ui.GmudWindow#draw()
	 */
	@Override
	public void draw() {
		drawBackground();
		g.drawText(pages.get(page), 4, 2, FontSize.FT_12PX, width - 8);
	}

}
